<?php
header("Content-type: text/xml");
require_once("include/global.php");

// print out the head
print <<<XML
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
    <title>Nonsenser&#39;s Evil-I am just a Nonsenser</title>
    <link>http://www.201qq.com</link>
    <description>Whenever you need a helping hand,it is at the end of your arm. And as you get older,you must remember that you have a second hand,the first one is to help yourself,the second is to help the others.</description>
XML;

$sql = "select * from blog_article order by log_PostTime desc";
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) == 0) die("<item><title>No article available</title></item>\n");
$rs = mysql_fetch_array($result); 
while($rs = mysql_fetch_object($result))
{
	echo "<item>\n";
	$time = strftime("%B %d,%Y,%H:%M %p",$rs->log_PostTime);
	echo "<title>".$rs->log_Title."</title>\n";
	echo "<link>http://www.201qq.com</link>\n";
    echo "<description><![CDATA[".$rs->log_Intro."]]></description>\n";
	echo "<author>".$rs->log_Author."</author>\n";
    echo "<pubDate>".$time."</pubDate>\n";
    echo "</item>\n";
}

//	print out the foot
print <<<XML
</channel>
</rss>
XML;
?>